package com.syzsn.sk8.repository;

import com.syzsn.sk8.entity.SySK8WorldCupRecord;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface SySK8WorldCupRecordRepository extends JpaRepository<SySK8WorldCupRecord, String> {

    @Query(value = "select * from SY_SK8_WORLDCUP_RECORD where WC_ID=?1 and RECORD_TYPE=?2 order by RECORD_NUM", nativeQuery = true)
    List<SySK8WorldCupRecord> findListByWcIdAndRecordType(Integer wcId, String recordType);

    @Query(value = "select * from SY_SK8_WORLDCUP_RECORD where WC_ID=?1 and RECORD_TYPE=?2 and RECORD_NUM=?3", nativeQuery = true)
    SySK8WorldCupRecord findOneByParam(Integer wcId, String recordType, int recordNum);
}
